import _00GraphFuc as gf
import _00GraphTreeFuc as gt

#计算熵与平均码长
W=[[0.08,'a'],[0.10,'b'],[0.12,'c'],[0.15,'d'],[0.20,'e'],[0.35,'f']]
tree=gt.Huffmantree(W)
codelist=gt.HuffmanCoding(tree)
print("W",W)
print("codelist",codelist)
[r0,r1]=gt.codingentropy(W,codelist)
print("r0,r1",r0,r1)